package com.jiyun.user.mapper;

import com.jiyun.Result.Result;
import com.jiyun.common.pojo.home.User;
import com.jiyun.common.pojo.user.Dto.UserPass;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface UserMapper {
    User login(User user);

    void register(User user);

//    @Update("update user set password=#{password} where id=#{id}")
//    Boolean updatePsd(User byId);

    // 根据用户名查询用户信息
//    User selectUserByUsername(@Param("username") String username);
    // 根据用户名更新用户密码
//    void updateUserPassword(@Param("username") String username, @Param("newPassword") String newPassword);

    void UpdatePassWord(UserPass userPass);

    void updateUser(User user);

    @Select("select * from user where id=#{id}")
    User findById(Integer id);

    List<User> findAll();
}
